package com.tender.controller.feign;

import com.tender.WebSocketServerApi;
import com.tender.WebSocketServerBizService;
import com.tender.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/ws/server")
public class WebSocketServerController implements WebSocketServerApi {

    @Autowired
    private WebSocketServerBizService webSocketServerBizService;

    // @GetMapping("/api/ws/server/count/all")
    @Override
    public Result<Integer> countAll() {
        return Result.success(webSocketServerBizService.userCount());
    }

    @Override
    public Result<Integer> pcCountAll() {
        return Result.success(webSocketServerBizService.pcCountAll());
    }

    @Override
    public Result<Integer> ipadCountAll() {
        return Result.success(webSocketServerBizService.ipadCountAll());
    }

    @Override
    public Result<Integer> appCountAll() {
        return Result.success(webSocketServerBizService.appCountAll());
    }
}
